﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeOffsetCurve3d : OdGeCurve3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeOffsetCurve3d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeOffsetCurve3d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeOffsetCurve3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeOffsetCurve3d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeOffsetCurve3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeOffsetCurve3d(OdGeCurve3d baseCurve, OdGeVector3d planeNormal, double offsetDistance) : this(GlobalsPINVOKE.new_OdGeOffsetCurve3d__SWIG_0(OdGeCurve3d.getCPtr(baseCurve), OdGeVector3d.getCPtr(planeNormal), offsetDistance), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeOffsetCurve3d(OdGeOffsetCurve3d source) : this(GlobalsPINVOKE.new_OdGeOffsetCurve3d__SWIG_1(OdGeOffsetCurve3d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCurve3d curve()
		{
			OdGeCurve3d result = new OdGeCurve3d(GlobalsPINVOKE.OdGeOffsetCurve3d_curve(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d normal()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeOffsetCurve3d_normal(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double offsetDistance()
		{
			double result = GlobalsPINVOKE.OdGeOffsetCurve3d_offsetDistance(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool paramDirection()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetCurve3d_paramDirection(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeMatrix3d transformation()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.OdGeOffsetCurve3d_transformation(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetCurve3d setCurve(OdGeCurve3d baseCurve)
		{
			OdGeOffsetCurve3d result = new OdGeOffsetCurve3d(GlobalsPINVOKE.OdGeOffsetCurve3d_setCurve(this.swigCPtr, OdGeCurve3d.getCPtr(baseCurve)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetCurve3d setNormal(OdGeVector3d planeNormal)
		{
			OdGeOffsetCurve3d result = new OdGeOffsetCurve3d(GlobalsPINVOKE.OdGeOffsetCurve3d_setNormal(this.swigCPtr, OdGeVector3d.getCPtr(planeNormal)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetCurve3d setOffsetDistance(double offsetDistance)
		{
			OdGeOffsetCurve3d result = new OdGeOffsetCurve3d(GlobalsPINVOKE.OdGeOffsetCurve3d_setOffsetDistance(this.swigCPtr, offsetDistance), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetCurve3d Assign(OdGeOffsetCurve3d offsetCurve)
		{
			OdGeOffsetCurve3d result = new OdGeOffsetCurve3d(GlobalsPINVOKE.OdGeOffsetCurve3d_Assign(this.swigCPtr, OdGeOffsetCurve3d.getCPtr(offsetCurve)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
